import 'package:flutter/material.dart';

class MyApp9 extends StatelessWidget {
  const MyApp9({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: AppBar(
              title: const Text('stack'),
              backgroundColor: Colors.black26,
              centerTitle: true,
            ),
            body: Center(
              child: Container(
                width: 300,
                height: 300,
                color: Colors.amber,
                child: Stack(
                  // 超出区域部分是否剪切
                  clipBehavior: Clip.none,
                  // 调整层叠位置
                  alignment: Alignment.center,
                  children: [
                    const Text('文字'),
                    const Icon(Icons.linked_camera, size: 20),
                    Positioned(
                      bottom: -20,
                      child: Image.asset('open_eyes.png'),
                    ),
                    // 可以有多个positioned
                    const Positioned(child: Text('data'))
                  ],
                ),
              ),
            )));
  }
}
